﻿@model DFYE.Web.Models.guestBook

@{
    ViewBag.Title = "reply";
}

<h2>reply</h2>
<style>
    .userReply
    {
        padding:8px;
        padding-left:22px;color:#338d1a; 
    }
    .manageReply
    {
        padding:8px;
        padding-left:22px;color:#ff6a00;
    }
    .dateTitle
    {
        font-size:18px; font-family:'Courier New';color:gray;
    }

</style>
<fieldset>
    <legend>回复留言</legend>
    <div>
        @Html.Raw(Model.content)

    </div>
    <div>
        <textarea name="_content" id="_replyContent" style="width:500px;height:40px"></textarea>
        <br />
        <button type="button" onclick="replySubmit()">回复</button>
        <form action="/manage/guestbook/reply/" method="post" id="replyForm">
            <input name="id" value="@Model.ID" type="hidden" />
            <input type="hidden" name="content" id="replyContent"/>
        </form>
        <script>
            String.prototype.trim = function () {
                // 用正则表达式将前后空格  
                // 用空字符串替代。  
                return this.replace(/(^\s*)|(\s*$)/g, "");
            }

            function replySubmit() {
                var _x=$("#_replyContent");
                if(_x.val().trim()==""){return false}

                $("#replyContent").val('[div class="manageReply"][div class="replyDate"]{datetime}[/div][div class="replayContent"]' + _x.val() + '[/div][/div]');
                $("#replyForm").get(0).submit();
            }

        </script>
    </div>
</fieldset>

<p>

    @Html.ActionLink("总留言列表", "topIndex" ) | 
    @Html.ActionLink("该学员留言列表", "Index", new { id = Model.studentID })
</p>
